﻿using System.Collections.Generic;
using System.Linq;
using com.cruxomatic.DTOs;
using com.cruxomatic.BusinessObjects;
using com.cruxomatic.BusinessObjects.DatabaseQueries;

namespace com.cruxomatic.BusinessFacades
{
    public class CompanyTypeFacade
    {
        public List<CompanyTypeInformation> GetAllCompanyTypes()
        {
            Queries queries = new Queries();
            IEnumerable<CompanyTypeInformation> companytypes = 
                from companyTypesList in queries.GetAllCompanyTypes()
                select ClassConverter
                .CopyCompanyTypeToCompanyTypeInformation(companyTypesList);
            return companytypes.ToList();
        }

        public List<CompanyTypeInformation> GetCompanyTypesForRole(int RoleID)
        {
            Queries queries = new Queries();
            IEnumerable<CompanyTypeInformation> companyTypes = from companyTypesList in queries.GetCompanyTypesForRole(RoleID)
                                                               select ClassConverter.CopyCompanyTypeToCompanyTypeInformation(companyTypesList);
            return companyTypes.ToList();
        }
    }
}
